<?php
/**
 * CreateTime: 2023/11/27 16:55
 * User:LinQ
 */

namespace App\Http\Requests\Company;

use App\Http\Requests\BasicFormRequests;

class CompanyRequest extends BasicFormRequests
{
    protected $rule =[
        'company_name' => 'required',
        'company_code' => 'required'
    ];

    // 为了适应国际化现在修改成了这样
    public function __construct(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null)
    {
        $this->message = [
            'company_name.required'=> trans('message.request_required',[
                'name' => trans('key.company')
            ]),
            'company_code.required'=>trans('message.request_required',[
                'name' => trans('key.company_code')
            ])
        ];
        parent::__construct($query, $request, $attributes, $cookies, $files, $server, $content);
    }

    protected $scene = [
        'create' => ['company_name','company_code']
    ];
}
